﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class BackpackItemDetail : MonoBehaviour
{
    public Text ItemName;
    public Text ItemDesc;

    public Button SellButton;
    public Button EquipButton;
    public Button CorporationButton;


    // Use this for initialization
    void Start ()
    {
		
	}

    public void SetData(BackpackItem iteminfo)
    {
        this.ItemName.text = iteminfo.ItemName;
        this.ItemDesc.text = iteminfo.ItemDesc;

        if (iteminfo.ItemOpreation == 1)
        {
            this.SetButtons(this.EquipButton.gameObject, false);
            this.SetButtons(this.CorporationButton.gameObject, false);
        }
        else if (iteminfo.ItemOpreation == 2)
        {
            this.SetButtons(this.EquipButton.gameObject, true);
            this.SetButtons(this.CorporationButton.gameObject, false);
        }
        else if (iteminfo.ItemOpreation == 3)
        {
            this.SetButtons(this.EquipButton.gameObject, false);
            this.SetButtons(this.CorporationButton.gameObject, true);
        }
        else
        {
            this.SetButtons(this.EquipButton.gameObject, false);
            this.SetButtons(this.CorporationButton.gameObject, false);
        }



    }

    private void SetButtons(GameObject btn,bool enable)
    {
        btn.SetActive(enable);
    }


}
